package com.yeren.list.linkedList;

import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;

public class LinkedListDemo2 {
	public static void main(String[] args) {
		List<String> staff=new LinkedList<String>();
		staff.add("Amy");
		staff.add("Bob");
		staff.add("Carl");
		staff.add("Dog");
		ListIterator<String> it=staff.listIterator();
		String first = it.next();
		String second = it.next();
		it.add("cat");
		
		System.out.println(first);
		System.out.println(second);
		System.out.println("==========");
		
		ListIterator<String> it2=staff.listIterator();
		
		while(it2.hasNext()){
			String next = it2.next();
			System.out.println(next);
		}
		
	}
}
